package err

const (
    HeaderErr   = 3000
    SignErr     = 3001
    ServerErr   = 5000
)

type Err struct {
    HeaderCode int
    Code       int
    Data       interface{}
    Message string
}


func (this *Err) Error() string {
    return this.Message
}

func NewErr(code int, msg string) *Err {
    e := new(Err)
    e.HeaderCode = 200
    e.Code = code
    e.Message = msg
    return e
}

func (this *Err) SetHeaderCode(code int) *Err {
    this.HeaderCode = code
    return this
}
